package com.netbao.fin.controller;


import com.netbao.fin.service.JieService;
import com.netbao.model.PageBean;
import com.netbao.model.PageResult;
import com.netbao.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.text.ParseException;

/**
 * @author suqk
 * @create 2019-11-06 14:39
 */
@Controller
@RequestMapping("fin/jie")
public class JieController {
    @Autowired
    private JieService jieService;

    @RequestMapping("page")
    public String topage(){
        return "fin/jie";
    }
    @GetMapping("listAll")
    @ResponseBody
    public PageResult listAll(PageBean pageBean, String name, String year, String mouth, String day){
        return jieService.listAll(pageBean,name,year,mouth,day);
    }
    @PostMapping("dan")
    @ResponseBody
    public Result dan(Long id, Long payment) throws ParseException {
        return jieService.dan(id,payment);
    }
}
